<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html class="no-js">
  <head>
   
    
    <title>订单详情</title>
	<meta name="description" content="这是一个 index 页面">
<meta name="keywords" content="index">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet" href="assets/css/amazeui.min.css"/>
<link rel="stylesheet" href="assets/css/admin.css">
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/app.js"></script>
<script type="text/javascript" src="assets/js/jquery-1.8.3.js"></script>
<script type="text/javascript">

	
	  $(document).ready(function(){//初始化使用钱数
	      	<c:forEach items="${roomtype}" var="ro">
          			<c:if test="${orderinfo.room.roomtypeid==ro.roomtypeid}">
          				 var jijia=${ro.roomprice}
          				 var moenytest=jijia*${timepoor};//计算房间价钱
          				 var zongjia=document.getElementById("money");//综合
          				 var roommoney=document.getElementById("roommoney");//单计算房间
          				 zongjia.innerHTML=jijia;
          				 <c:choose>
          					 <c:when test="${orderinfo.residents.vipid==2}">/* 会员 */
          					 		moenytest=moenytest*0.8;
          					 		moenytest=moenytest.toFixed(2);
          					 		roommoney.innerHTML=parseInt(moenytest);
          					 		 zongjia.innerHTML=parseInt(moenytest);
          					 		 //alert(moenytest);
          					 		
          					 </c:when>
          					  <c:when test="${orderinfo.residents.vipid==1}">/*pingming */
          					 		moenytes=moenytest*1;
          					 		roommoney.innerHTML=moenytest.toFixed(2);
          					 		 zongjia.innerHTML=moenytest.toFixed(2);
          					 </c:when>
          				 </c:choose>
          			</c:if>
          		</c:forEach>
          		
          		
	    });
	    
	function aa(){
	
	<c:forEach items="${roomtype}" var="ro">
	var zongjia=0;//初始化总价
          			<c:if test="${orderinfo.room.roomtypeid==ro.roomtypeid}">
          				var jijia=parseInt(document.getElementById("roommoney").innerText);//房间价钱
          			</c:if>
    </c:forEach>
    
    
	var demo = document.getElementsByName("wupin");
	
	var xuanze=[];
	var checkboxes=[];
            //根据所选id给checkboxes数组单价集合
              for(i=0;i<demo.length;i++){
        		if(demo[i].checked){
            		 <c:forEach items="${goods}" var="good">
							 if(${good.goodsid}==demo[i].value){
								 checkboxes.push(${good.goodsprice});
							 }
          			 </c:forEach> 
            		
        		}
   			 }
   			 
   			  for(i=0;i<demo.length;i++){
        		if(demo[i].checked){
            		  xuanze.push(demo[i].value);
        		}
   			 }
    
	//alert(checkboxes);//是所选物品的单价集合
	//alert(xuanze);//是所选物品的id集合
    //循环计算 钱数
    	          				
    
    for(i=0;i<checkboxes.length;i++){
   		zongjia+=parseInt(checkboxes[i]);
    }
    
    
    zongjia+=jijia;
   // alert(zongjia);
    	var showMoney=document.getElementById("money");
        showMoney.innerHTML=zongjia;
        
	};
	  
	 function jiezhang(){
	 	var money=document.getElementById("money").innerText;//money
		var demo = document.getElementsByName("wupin");
		var xuanze=[];
		 for(i=0;i<demo.length;i++){
        		if(demo[i].checked){
            		  xuanze.push(demo[i].value);
        		}
   			 }
	  
	    //alert(money);
	if(money==0){
		alert("开户结算时间不能小于一分钟");
	}else{
		window.location.href="jiezhang?oid="+${orderinfo.orderid}+"&roomid="+${orderinfo.roomid}+"&money="+money+"&gods="+xuanze;
	}
		
		
	 }
	      
</script>

</head>

		
<body>
<header class="am-topbar admin-header">
  <div class="am-topbar-brand"><img src="assets/i/logo.png"></div>

  <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
    <ul class="am-nav am-nav-pills am-topbar-nav admin-header-list">

   <li class="am-dropdown tognzhi" data-am-dropdown>
  <button class="am-btn am-btn-primary am-dropdown-toggle am-btn-xs am-radius am-icon-bell-o" data-am-dropdown-toggle>${user.username}&nbsp;&nbsp;&nbsp;</button>
  <ul class="am-dropdown-content">
  	
  	
  	
    <!--<li class="am-dropdown-header">所有消息都在这里</li>-->

    

<li><a href="exitLogin">用户注销<span class="am-badge am-badge-danger am-round"></span></a></a></li>    
  </ul>
</li>




      <li class="am-hide-sm-only" style="float: right;"><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>
    </ul>
  </div>
</header>

<div class="am-cf admin-main"> 

<div class="nav-navicon admin-main admin-sidebar">
      <div class="sideMenu am-icon-dashboard"
				style="color:#aeb2b7; margin: 10px 0 0 0;"> 欢迎系统管理员：${user.username}</div>
    <div class="sideMenu">
      <h3 class="am-icon-flag">
					<em></em> <a href="#">订单管理</a>
				</h3>
      <ul>
        <li><a href="orderList">订单列表</a></li>
        <!--<li class="func" dataType='html' dataLink='msn.htm' iconImg='images/msn.gif'>添加订单</li>-->
        <li><a href="addorder">添加订单</a></li>
       <!--<li><a href="商品列表.html">订单详情</a></li>-->

      </ul>
      <h3 class="am-icon-cart-plus">
					<em></em> <a href="#"> 物品管理</a>
				</h3>
      <ul>
        <li><a href="getAllGoods">物品详情</a></li>
      </ul>
      <h3 class="am-icon-cart-plus">
					<em></em> <a href="#"> 房间管理</a>
				</h3>
      <ul>
        <li><a href="getAllRoom">房间信息</a></li>
        <li><a href="roomListU">房间类型信息</a></li>
      </ul>
    
    <script type="text/javascript">
			jQuery(".sideMenu").slide({
				titCell:"h3", //鼠标触发对象
				targetCell:"ul", //与titCell一一对应，第n个titCell控制第n个targetCell的显示隐藏
				effect:"slideDown", //targetCell下拉效果
				delayTime:300 , //效果时间
				triggerTime:150, //鼠标延迟触发时间（默认150）
				defaultPlay:true,//默认是否执行效果（默认true）
				returnDefault:true //鼠标从.sideMen移走后返回默认状态（默认false）
				});
				
			
		</script> 

    
    
    
    
    
    
    
</div>

<div class=" admin-content">
	
		<div class="daohang">
			<ul>
			<li><button type="button" class="am-btn am-btn-default am-radius am-btn-xs">前台<a href="getAllGoods" class="am-close am-close-spin" data-am-modal-close="">×</a></button></li>
			
			
<c:if test="${user.roleid==1}">
				
				
				<li><button type="button" class="am-btn am-btn-default am-radius am-btn-xs">后台管理<a href="GMgetAllGoods" class="am-close am-close-spin" data-am-modal-close="">×</a></button></li>				
				
				
				</c:if>		
			</ul>

       

	
</div>
	
	


<div class="admin-biaogelist">
	
    <div class="listbiaoti am-cf">
      <ul class="am-icon-flag on"> 订单结算</ul>
      
      <dl class="am-icon-home" style="float: right;"> 当前位置： 首页 > <a href="#">订单结算</a></dl>

      
      
    </div>
	
    <div class="fbneirong">
      <form class="am-form">
      	
      	<div class="am-form-group am-cf">
          <div class="zuo">订单号码：</div>
          <div class="you">
          	
          		${orderinfo.orderid}
          	
           <!--
          <input type="password" class="am-input-sm" id="doc-ipt-pwd-1" placeholder="请输入关键词">
        	 -->
        <!--<select id="roomType">
         		 		<option>请选择</option>
         		 	
         		 </select>-->
          	
          </div>
        </div>
      	
       <div class="am-form-group am-cf">
          <div class="zuo">房间号码：</div>
          <div class="you">
          	
          	${orderinfo.roomid}
          	
          	
          </div>
        </div>
        
        
        <div class="am-form-group am-cf">
          <div class="zuo">住宿时间：</div>
          <div class="you" >
          	
          	<span style="color: #0E90D2;font-size: 17px">【${orderinfo.ordercreatetime}】</span>  ---  <span style="color: #0E90D2;font-size: 17px">【${nowtime}】</span>
          	
          	
          </div>
        </div>
       
       <div class="am-form-group am-cf">
          <div class="zuo">价格计算：</div>
          <div class="you" style="float: left;">
          	
          		<c:forEach items="${roomtype}" var="ro">
          			<c:if test="${orderinfo.room.roomtypeid==ro.roomtypeid}">
          				 <c:forEach items="${vip}" var="vip">
          				 		<c:if test="${orderinfo.residents.vipid==vip.vipid}"><!-- //如果是vip -->
          				 			 <span style="color: #0E90D2;font-size: 15px">【${timepoor}】</span>天数	*  <span style="color: #0E90D2;font-size: 15px">【${ro.roomprice}】</span>单价      *   <span style="color: #0E90D2;font-size: 15px">【<c:choose><c:when test="${vip.vipid==2}">8折</c:when><c:otherwise>全价</c:otherwise> </c:choose>】</span>${vip.vipname}
          				 		</c:if>
          				 </c:forEach>
          			</c:if>
          		</c:forEach>
         		
          </div>
        </div>
        
        <div class="am-form-group am-cf">
          <div class="zuo">房间价格：</div>
          <div class="you" style="float: left;">
          		
          		<span id="roommoney">房间价钱</span>
         		
          </div>
        </div>
        
        <div class="am-form-group am-cf">
          <div class="zuo">住户姓名：</div>
          <div class="you">
          		${orderinfo.residents.residentsname}
             <!--<input type="password" class="am-input-sm" id="doc-ipt-pwd-1" placeholder="请输入身份证">-->
          </div>
        </div>
        <div class="am-form-group am-cf">
          <div class="zuo">住户身份证：</div>
          <div class="you">
          	${orderinfo.residents.cardnumber}
          </div>
        </div>
        
        
        <div class="am-form-group am-cf">
          <div class="zuo">使用物品：</div>
          <div class="you">
          <!-- 	冰阔落&nbsp;&nbsp;&nbsp;  <input style="width: 40px" class="am-input-sm" id="doc-ipt-pwd-1" placeholder="数量"/>  &nbsp;&nbsp;&nbsp;&nbsp; 6￥ -->
            <!--<textarea class="" rows="2" id="doc-ta-1"></textarea>-->
            
           <c:forEach items="${goods}" var="good">
            	<input type="checkbox" value="${good.goodsid}" onchange="aa()" name="wupin" id="wupin"/>${good.goodsname}&nbsp;￥${good.goodsprice}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </c:forEach>
          </div>
        </div>
        
        <div class="am-form-group am-cf">
          <div class="zuo">总和：</div>
          <div class="you">
          		<span id="money">钱数</span>
            <!--<textarea class="" rows="2" id="doc-ta-1"></textarea>-->
          </div>
        </div>
        
        
        <div class="am-form-group am-cf">
        </div>
        <div class="am-form-group am-cf">
          <div class="you" style="margin-left: 11%;">
              <button onclick="jiezhang()" type="button" class="am-btn am-btn-success am-radius">结账</button>
              <!--&nbsp;&raquo; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <button type="submit" class="am-btn am-btn-secondary am-radius">返回上一页</button>-->

          </div>
        </div>
      </form>
    </div>

  
 
 <div class="foods">
  <ul>
    版权所有  <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> -  More Templates<a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>
  </ul>
  <dl>
    <a href="" title="返回头部" class="am-icon-btn am-icon-arrow-up"></a>
  </dl>
</div>




</div>

</div>

</div>


</body>
</html>
